DevJourney

C/Odd numbers 1 to 50/Odd in limit/WHILE/ODDINLIM.C

//program to input higher and lower limit and print odd numbers in it
#include<stdio.h>
#include<conio.h>
int main()
{
	int l,h,i;
	
	printf("Enter upper limit : ");
	scanf("%d",&h);
	printf("Enter lower limit : ");
	scanf("%d",&l);
	i=l;
	while(i%2==0)
		{
			i=i+1;
		}
	while(i<=h)
		{
			printf("%d ",i);
			i=i+2;
		}
	getch();
    return 0;
}
View on GitHub